package com.hc.window.settingView;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;

import com.hc.util.CommonData;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Setting_baseStation_jitter extends JPanel{
	private JTextField textField_b1;
	private JTextField textField_b2;
	private JTextField textField_b3;
	private JTextField textField_4;
	public Setting_baseStation_jitter() {
		setLayout(null);
		
		JLabel lblNewLabel = new JLabel("\u57FA\u7AD91\uFF1A");
		lblNewLabel.setBounds(24, 22, 48, 26);
		add(lblNewLabel);
		
		textField_b1 = new JTextField();
		textField_b1.setBounds(82, 22, 161, 26);
		add(textField_b1);
		textField_b1.setColumns(10);
		
		JLabel label = new JLabel("\u57FA\u7AD92\uFF1A");
		label.setBounds(266, 22, 48, 26);
		add(label);
		
		textField_b2 = new JTextField();
		textField_b2.setColumns(10);
		textField_b2.setBounds(324, 22, 161, 26);
		add(textField_b2);
		
		JLabel label_1 = new JLabel("\u57FA\u7AD93\uFF1A");
		label_1.setBounds(24, 59, 48, 26);
		add(label_1);
		
		textField_b3 = new JTextField();
		textField_b3.setColumns(10);
		textField_b3.setBounds(82, 59, 161, 26);
		add(textField_b3);
		
		JLabel label_2 = new JLabel("\u57FA\u7AD94\uFF1A");
		label_2.setBounds(266, 59, 48, 26);
		add(label_2);
		
		textField_4 = new JTextField();
		textField_4.setColumns(10);
		textField_4.setBounds(324, 59, 161, 26);
		add(textField_4);
		
		JButton button = new JButton("\u786E\u5B9A");
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				try{
					
					CommonData.baseStation_JN_1  = Integer.parseInt(textField_b1.getText());
					CommonData.baseStation_JN_2  = Integer.parseInt(textField_b2.getText());
					CommonData.baseStation_JN_3  = Integer.parseInt(textField_b3.getText());
					CommonData.baseStation_JN_4  = Integer.parseInt(textField_4.getText());
				}catch (Exception e1) {

					System.out.println(e1);
				}
				
				
			}
		});
		button.setBounds(505, 60, 95, 25);
		add(button);
		
		
		iniData();
	}
	private void iniData() {
		textField_b1.setText(CommonData.baseStation_JN_1+"");
		textField_b2.setText(CommonData.baseStation_JN_2+"");
		textField_b3.setText(CommonData.baseStation_JN_3+"");
		textField_4.setText(CommonData.baseStation_JN_4+"");
		
	}

}
